class Group < ActiveRecord::Base
	has_many :memberships
	belongs_to :frequency
	belongs_to :match_method
	has_many :swaps
	
	def owner
		users.find(owner_id);
	end
	
	def admins
		adminstrators = memberships.find(:select => [:user], :conditions "admin = 1")
		users.find(administrators)
	end
	
	def users
		ids = memberships.find(:select => [:user])
		users.find(ids)
	end
end
